package be.ac.ua.auctioneer;

import java.rmi.RMISecurityManager;

import be.ac.ua.codebase.Product;

public class AuctioneerManagerServer {


	public static void main(String[] args) throws Exception {
		System.setSecurityManager(new RMISecurityManager());
		
		String reg = "localhost";
		if(args.length > 1) {
			reg = args[1];
		}
		AuctioneerManager auctioneerManager = new AuctioneerManager(reg);
		Thread.sleep(1000);
		try {
			auctioneerManager.registerWithBank();
			auctioneerManager.getBank().credit(auctioneerManager.getBankAccountID(), 1500);
			auctioneerManager.run();
		} catch(Exception e) {
			System.out.println("[AUCTIONEERMANAGER] Registry with bank failed.");
			e.printStackTrace();
		}
	}

}
